package za.ac.cput.arrowgame.model;

import java.util.Arrays;
import java.util.List;

public enum Direction {

    NORTH("north"), //
    NORTHEAST("northeast"), //
    EAST("east"), //
    SOUTHEAST("southeast"), //
    SOUTH("south"), //
    SOUTHWEST("southwest"), //
    WEST("west"), //
    NORTHWEST("northwest");
    
    private String code;

    private Direction(String c) {
        code = c;
    }

    public String getCode() {
        return code;
    }
    
    public int getOrdinalValue() {
        Direction[] directions = Direction.values();
        List<Direction> directionsList = Arrays.asList(directions);
        return directionsList.indexOf(this);
    }

}
